﻿using CodeGenerator.ClassServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeGenerator.Models
{
    public class LookupModel
    {
        public int Id { get; set; }
        public AttributeModel SourceAttribute { get; set; }
        public AttributeModel DestAttribute { get; set; }
        public int DisplayLengthInGrid { get; set; }

        public LookupModel() { }
        internal LookupModel(LookupModelDto dto)
        {
            this.Id = dto.Id;
            if (dto.SourceAttribute != null)
            {
                this.SourceAttribute = new AttributeModel(dto.SourceAttribute);
            }
            if (dto.DestAttribute != null)
            {
                this.DestAttribute = new AttributeModel(dto.DestAttribute);
            }
            this.DisplayLengthInGrid = dto.DisplayLengthInGrid;
        }
    }
}
